package com.mask.lambda;

public class CalculatorTest {

    public static void sub(int n1, int n2) {
        Calculator calculator = (a,b) -> a-b;
        System.out.println(n1+","+n2+"两数相减为:"+calculator.operation(n1,n2));
    }

    public static void multi(int n1, int n2) {
        Calculator calculator = (a,b) -> a * b;
        System.out.println(n1+","+n2+"两数相乘为:"+calculator.operation(n1,n2));
    }

    public static void div(int n1, int n2) {
        Calculator calculator = (a,b) -> a / b;
        System.out.println(n1+","+n2+"两数相除为:"+calculator.operation(n1,n2));
    }

    public static void main(String[] args) {
        sub(4,2);
        multi(4,2);
        div(4,2);

    }
}
